package com.lius.SpringBootStart.mapper;

import com.lius.SpringBootStart.domain.Video;
import org.springframework.stereotype.Repository;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Repository
public class VideoMapper {
    private static Map<Integer, Video> videoMap = new HashMap<>();


    static {
        videoMap.put(1,new Video(1,"Java基础课程，JavaSE入门到退学"));
        videoMap.put(2,new Video(2,"JavaWeb从入门到放弃"));
        videoMap.put(3,new Video(3,"SpringBoot从零开始，成长大神"));
        videoMap.put(5,new Video(5,"Python从入门到判刑"));
        videoMap.put(8,new Video(8,"MySQL从安装到删库跑路"));
        videoMap.put(9,new Video(9,"如何在Linux下使用rm -rf /"));
    }

    public List<Video> listVideo(){
        List<Video> list = new ArrayList<>();

        list.addAll(videoMap.values());
        return list;
    }
}
